
{extend name='public/window' /}

{block name="content"}

<div class="layui-fluid">
    <div class="layui-card">

        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" lay-filter="form">
            <div class="layui-tab layui-tab-brief">
                <ul class="layui-tab-title">
                    <li class="layui-this">参数设置</li>
                    <li><a href="{:url('log')}">日志信息</a></li>
                </ul>
                <div class="layui-tab-content" style="margin-top: 20px;">

                    <div class="layui-tab-item layui-show">

                        <div class="layui-form-item">
                            {php}list($start_h, $start_m) = explode(':', $data['starttime']);{/php}
                            <label class="layui-form-label">开始时间：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="start_h" value="{$start_h}" class="layui-input" style="width: 50px; display: inline;">
                                时
                                <input type="text" name="start_m" value="{$start_m}" class="layui-input" style="width: 50px; display: inline;">
                                分
                            </div>
                            {php}list($end_h, $end_m) = explode(':', $data['endtime']);{/php}
                            <label class="layui-form-label">结束时间：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="end_h" value="{$end_h}" class="layui-input" style="width: 50px; display: inline;">
                                时
                                <input type="text" name="end_m" value="{$end_m}" class="layui-input" style="width: 50px; display: inline;">
                                分
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">放出数量：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="count" value="{$data.count}" class="layui-input">
                            </div>
                            <label class="layui-form-label" style="width: auto;">执行间隔：{$data.sleep_s} - {$data.sleep_b}秒</label>
                        </div>

                    </div>

                    

                </div>

            </div>
                <div class="layui-form-item layui-layout-admin " style="width: 100%">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0px;text-align: center;">
                            <button class="layui-btn" lay-submit="" lay-filter="exe">提交</button>
                            <button type="reset" class="layui-btn layui-btn-primary">{:__('Reset')}</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script>
    layui.use(['element', 'form', 'jquery','lucky'], function () {
        var element = layui.element;
        var table = layui.table;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky=layui.lucky;

        form.on('submit(exe)', function (data) {
            // layer.msg('正在执行。。', { icon: 1, time: 0, shade: 0.3, anim: 4 });
            Execute("{:url('index')}",data.field);
            return false;
        });

    })

    function Execute(url, data){
        $.post(url,data,function(res){
            layer.msg(res.msg, { icon: 1, time: 1500, shade: 0.3, anim: 4 });
        });
    }
    
</script>

{/block}

